<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<script src="../webapp/BootStrap/js/jquery.js"></script>
	<script src="../webapp/BootStrap/js/bootstrap.js"></script>
	<link rel="stylesheet" href="../webapp/BootStrap/css/bootstrap.css">
	<script src="../webapp/static/layui/layui.js"></script>
	<link rel="stylesheet" href="../webapp/static/layui/css/layui.css">
	<title>用户钱包页面</title>
	<style>
	#father{
		background-color: #f0f2f5;
		height: 1200px;
		width: 100%;
		float: right;
		border-width: 2px;
		border-color: #cccccc;
		border-style: solid;
	}
	#topBox,#minBox{
		padding-left: 2%;
		padding-top: 1%;
		height:5%;
		width: 100%;
		float: left;
	}

	.colorBox{
		height: 70%;
		width: 0.5%;
		background-color: #6495ED;
		float: left;
	}
	.textBox{
		line-height: 200%;
		font-size: 120%;
		float: left;
	}
	#information{
		background-color: white;
		height: 26%;
		width: 96%;
		float: left;
		margin: 0% 2% 0.25% 2%;
		border-radius: 5px;
		padding: 2%;
	}
	#informationLeft{
		width: 19%;
		height: 100%;
		float: left;
	}
	#userImg{
		background-color: #00b7ee;
		border: white 0px solid;
		width: 220px;
		height: 220px;
	}
	#textBox2{
		padding-top: 2.5%;
		font-size: 120%;
		padding-left: 25%;
	}
	#img1{
		width: 100%;
		height: 100%;
	}


	#informationRight{
		padding-left: 5%;
		padding-top: 1%;
		width: 80%;
		height: 100%;
		float: left;
		border-left: #9c9c9c 1px solid ;
	}

	.textBoxes{
		float: left;
		padding: 0% 4% 1% 0%;
		height: 25%;
		width: 25%;
		font-size: 110%;
		margin-bottom: 1.5%;
	}
	.colorBox2,.colorBox3,.colorBox4,.moneyBox{
		border-top-left-radius: 5px;
		border-bottom-left-radius: 5px;
		border-top-right-radius: 50px;
		float: left;
		color: white;
		height:70%;
		width: 35%;
		line-height: 240%;
		font-weight: bold;
	}
	.colorBox2{
		background-color:#6495ED;
		padding-left: 8%;
	}
	.colorBox3{
		background-color:#6495ED;
		padding-left: 4%;
	}
	.colorBox4{
		background-color:#6495ED;
		padding-left: 1%;
		font-size: 85%;
	}
	.moneyBox{
		padding-left: 1%;
		font-size: 85%;
		background-color: mediumvioletred;
	}

	.bottomLine,.moneyLine{
		float: left;
		height:70%;
		width: 65%;
		line-height: 240%;
		padding-left: 2%;

	}
	.bottomLine{
		border-bottom:#6495ED 3px solid;
	}
	.moneyLine{
		border-bottom:mediumvioletred 3px solid;
	}
	#buttonGroup{
		width: 100%;
		height: 25%;

	}
	.button1{
		background-color:mediumvioletred;
		width: 22%;
		height: 90%;
		margin-left: 1%;
		border: mediumvioletred 1px solid;
		border-radius:100px;
		font-size: 130%;
		color: white;
	}
	.button1:active{
		background-color: white;
		border: mediumvioletred 1px solid;
		color: black;
	}
	.button10{
		background-color:lightseagreen;
		width: 22%;
		height: 90%;
		margin-left: 1%;
		border: lightseagreen 1px solid;
		border-radius:100px;
		font-size: 130%;
		color: white;
	}
	.button10:active{
		background-color: white;
		border: lightseagreen 1px solid;
		color: black;
	}


	#tableBox{
		background-color: white;
		height: 62%;
		width: 96%;
		float: left;
		margin: 0.25% 2% 0% 2%;
		border-radius: 5px;
		padding: 2%;
		font-size: 100%;

	}
	#findBox{
		height: 7%;
		width: 100%;
		background-color: #f0f2f5;
		margin-bottom: 1%;
		border-radius: 5px;
		font-size: 120%;
		padding: 0.75%;
	}
	#find1,#find2,#find3,#find4{
		float: left;
		margin-right: 0%;
		height: 100%;
	}
	#find1{
		width: 17%;
	}
	#find2{
		width: 30%;
	}

	.textInput{
		width: 60%;
		height:92%;
		float: left;
	}
	.moneyInput{
		width: 35%;
		height: 94%;
		float: left;
	}

	.textBox2{
		float: left;
		line-height: 125%;
	}

	#button2{
		margin-left: 3%;
		width: 6%;
		height: 100%;
		font-size: 70%;
		background-color:  #00b7ee;
		color: #FFFFFF;
		border: 5px #00b7ee solid;
		border-radius: 10px;
		float: left;
	}
	#button3{
		margin-left: 1%;
		width: 6%;
		height: 100%;
		font-size: 70%;
		background-color: gray;
		color: #FFFFFF;
		border: 5px gray solid;
		border-radius: 10px;
		float: left;
	}
	#button4{
		margin-left: 1%;
		width: 6%;
		height: 100%;
		font-size: 70%;
		background-color: indianred;
		color: #FFFFFF;
		border: 5px indianred solid;
		border-radius: 10px;
		float: left;
	}
	#updateImg{
		background-color: #00b7ee;
		color: white;
		border-radius: 5px;
		border: #00b7ee 1px solid;
	}
	#updateImg:active{
		background-color: white;
		color: black;
		border-radius: 5px;
		border: #00b7ee 1px solid;
	}
	.operationButton,.operationButton2{
		height: 100%;
		width: 95%;
		border-radius: 2px;
		border: #00b7ee 1px solid;
		margin-right: 1%;
		font-size: 90%;
	}
	.operationButton{
		color: white;
		background-color: #00b7ee;
	}


	.operationButton2{
		color: black;
		background-color: white;;
	}

	.buttongrop2{
		width: 40px;
		height: 40px;
		background-color: white;
		border-radius: 5px;
		border: #6495ED 1px solid;
	}
	.buttongrop{
		color: white;
		width: 75px;
		height: 40px;
		background-color:#6495ED;
		border-radius: 5px;
		border:white 0px solid;
	}
	th{
		text-align: center;
	}
	.input3{
		width: 65%;
		text-align: center;
		float: right;

	}
	.sel3{
		width: 65%;
		text-align: center;
		float: right;
		text-align: center;
		text-align-last: center;

	}
	</style>

	<script>
		var zhen = 0;
		firstGet();
	function firstGet(){

		var startMoney=$("#startMoney").val();
		var endMoney=$("#endMoney").val();
		if(startMoney!=""||endMoney!=""){
		}else{
			startMoney=0.0;
			endMoney=0.0;
		}
		var pageSize=$("#pageSize").val();
		if(pageSize==""){
			pageSize=3;
		}
		var userordernum=$("#userordernum").val();
		if(userordernum==""){
			userordernum=null;
		}
		var userordersettlementstatus=$("#userordersettlementstatus").val();
		if(userordersettlementstatus==""){
			userordersettlementstatus=null;
		}
		var userorderstatus=$("#userorderstatus").val();
		if(userorderstatus){
			userorderstatus=null;
		}
		$.ajax({
			url:"/money/find",
			type:"get",
			datatype:"json",
			data:{"startMoney":startMoney,"endMoney":endMoney,"pageSize":pageSize,"userordernum":userordernum,"userordersettlementstatus":userordersettlementstatus,"userorderstatus":userorderstatus},

			success:function(data) {
			show(data);
			}
		})

	}
	function pm(num){
		var startMoney=$("#startMoney").val();
		var endMoney=$("#endMoney").val();
		if(startMoney!=""||endMoney!=""){
		}else{
			startMoney=0.0;
			endMoney=0.0;
		}
		var pageSize=$("#pageSize").val();
		if(pageSize==""){
			pageSize=3;
		}
		var userordernum=$("#userordernum").val();
		if(userordernum==""){
			userordernum=null;
		}
		var userordersettlementstatus=$("#userordersettlementstatus").val();
		if(userordersettlementstatus==""){
			userordersettlementstatus=null;
		}
		var userorderstatus=$("#userorderstatus").val();
		if(userorderstatus){
			userorderstatus=null;
		}
		var pageNum=num;
		$.ajax({
			url:"/money/find",
			type:"get",
			datatype:"json",
			data:{"pageNum":pageNum,"startMoney":startMoney,"endMoney":endMoney,"pageSize":pageSize,"userordernum":userordernum,"userordersettlementstatus":userordersettlementstatus,"userorderstatus":userorderstatus},

			success:function(data){
				show(data);
			}
		})

	}

		function show(data){
			$("#uid").val(data.user.userUserIdentityid);
			$("#userName").text(data.user.username);
			$("#userSex").text(data.user.usersex==1?"男":"女");
			$("#userEmail").text(data.user.useremail);
			$("#userPhone").text(data.user.userphone);
			$("#ordinaryMoney").text(data.list[0].ordinarymoney+"元");
			$("#ordinaryDeposit").text(data.list[0].ordinarydeposit+"元");
			$("#orderNumbers").text(data.orderNumbers);
			$("#userregistrationTime").text(data.user.userregistrationtime);
			var src =data.user.userphoto;
			$("#img1").attr("src",src)
			var html2="";
			var bedname=""
			for(var i in data.order.list){
				var u =data.order.list[i];
				var dd=u.userorderstatus==4?"历史订单":"当前订单";
				var js=u.userordersettlementstatus==1?"正常结算":"异常结算";
				var zt=u.userorderstatus;

				 bedname+="<option value='"+u.userordernum+"'>"+u.userordernum+"</option>"
				html2+="<tr>"+
						"<td><input type='hidden' id='o"+u.userordernum+"' value='"+u.userorderid+"'/>"+u.userordernum+"</td>" +
						"<td><input type='hidden' id='m"+u.userordernum+"' value='"+u.bedMessageid+"'/>"+u.userorderstarttime+"</td>" +
						"<td>"+u.userorderendtime+"</td>" +
						"<td><input type='hidden' id='t"+u.userorderid+"' value='"+u.userorderleasetime+"'/>"+u.userorderleasetime+"</td>"
				switch (zt){
					case 1:
						html2+="<td>待支付</td>"
						break;
					case 2:
						html2+="<td>已支付</td>"
						break;
					case 3:
						html2+="<td>进行中</td>"
						break;
					case 4:
						html2+="<td>已完成</td>"
						break;
				}
				html2+="<td><input type='hidden' id='g"+u.userorderid+"' value='"+data.order.list[i].bedMessageid+"'>"+dd+"</td>" +
						"<td>"+js+"</td>" +
						"<td><input type='hidden' id='z"+u.userorderid+"' value='"+u.userorderrent+"'>"+u.userorderrent+"</td>" +
						"<td>"

				if(u.userordersettlementstatus!=1){
					var o=u.userorderabnormal;
					html2+="<input type='button' onclick= alert('异常原因："+u.userorderabnormal+"') class='operationButton' value='异常详情'/>"
				}
				html2+="</td>" +
						"<td>";

				if(zt==2||zt==3){
					html2+="<input type='button' class='operationButton' onclick='cao("+u.userorderid+")' value='强制结算'/>"
				}else if(zt==1){
					html2+="<input type='button' class='operationButton' onclick='mai("+u.userorderid+")' value='立即购买'/>"
				}

				switch (zt){
					case 1:
					//	html2+="<input type='button' class='operationButton' onclick='cao("+u.userorderid+",2)' value='直接支付'/>"
						break;
					case 2:
						// html2+="<input type='button' class='operationButton' onclick='cao("+u.userorderid+")' value='强制结算'/>"
						 break;
					 case 3:
					// 	html2+="<input type='button' class='operationButton' onclick='cao("+u.userorderid+")' value='强制结算'/>"
					// 	break;
					case 4:
						break;
				}
					html2+="</td>"+
							"<td>"
				if(u.userorderstatus==4) {
					html2 +=
							"<input type='button' onclick='del(" + u.userorderid + ")' class='operationButton2' value='删除'/>"

				}
				html2+="</td>" +
						"</tr>"
			}
			$("tbody").html(html2);
			$("#bedName").html(bedname);

			var html3="";
			html3+= "<button type='button' class='buttongrop' onclick='ye("+data.order.navigateFirstPage+")'>首页</button>"

			for(var i in data.order.navigatepageNums){
				html3+="<button type='button' class='buttongrop2' onclick='ye("+data.order.navigatepageNums[i]+")'>"+data.order.navigatepageNums[i]+"</button>"
			}
			html3+="<button type='button' class='buttongrop' onclick='ye("+data.order.navigateLastPage+")'>尾页</button>"

			$("#fenye").html(html3);

			$(window.parent.document).find("#yonghu").html(data.user.username);

			if(data.zhenshi.useridentitybankcard!=null&&data.zhenshi.useridentitybankcard!=undefined) {
				$("#mcard").val(data.zhenshi.useridentitybankcard);
				zhen=1;
			}

			if(data.zhenshi.useridentityrealname!=null&&data.zhenshi.useridentityrealname!=undefined) {
				$("#mname").val(data.zhenshi.useridentityrealname);
			}

	}
	function ye(num){
		pm(num);
	}

	function  find(){
		firstGet();
	}

	function del(d){
		$.ajax({
			url:"/user/deleteorder",
			type:"delete",
			data:{'userorderId':d},
			datatype:"json",
		success:function(data){
				if(data){
					firstGet();
				}else{
					alert("操作失败!");
				}
		}
		})

	}

	function clean(){
		$("#userordernum").val("");
		$("#startMoney").val("");
		$("#endMoney").val("");
		$("#userorderstatus").val(0);
		$("#userordersettlementstatus").val(0);
	}

	function cao(id){
		$.ajax({
			url:"/user/updateuserorder",
			type:"post",
			data:{'userorderId':id},
			datatype:"json",
			success:function(data){
				if(data){
					firstGet();
				}else{
					alert("操作失败!");
				}
			}
		})

	}
	function baoxiu(){
		var id = $("#bedName").val();

		var userUserOrderid =$("#o"+id).val();
		var	userfeedbacktype = $("#type").val();
		var	userfeedbackcontent = $("#userfeedbackContent").val();

		var bedmessageId=$("#m"+id).val();

		$.ajax({
			url:"/feedback/insertfeed",
			type:"post",
			data:{'userUserOrderid':userUserOrderid,"userfeedbacktype":	userfeedbacktype,"userfeedbackcontent":userfeedbackcontent,"bedmessageId":bedmessageId},
			datatype:"json",
			success:function(data) {
				alert(data)
			}
		})

	}


		function MoneyRecharge(){
			var money= $("#money1").val();
			if(zhen==1) {
				$.ajax({
					url: "/money/money",
					type: "post",
					datatype: "json",
					data: {"i": 1, "money": money},

					success: function (data) {
						if (data != false) {
							alert("充值成功！您目前的钱包金额为：" + data);
							$("#ordinaryMoney").text(data + "元");
						} else {
							alert("充值失败");
						}

					}
				})
			}else{
				alert("请完善信息后再操作")
			}
		}
		function DepositRecharge(){
			var money= $("#money2").val();

			if(zhen==1) {
				$.ajax({
					url: "/money/money",
					type: "post",
					datatype: "json",
					data: {"i": 2, "money": money},

					success: function (data) {
						if (data != false) {
							alert("充值成功！您目前的押金金额为：" + data);
							$("#ordinaryDeposit").text(data + "元");
						} else {
							alert("充值失败");
						}

					}
				})
			}else{
				alert("请完善信息后再操作")
			}
		}
		function DepositReturn() {
			var money = $("#ordinaryDeposit").val();
			if (money!=0) {

				$.ajax({
					url: "/money/money",
					type: "post",
					datatype: "json",
					data: {"i": 3, "money": money},

					success: function (data) {
						if (data != false) {
							alert("退还成功！");
							$("#ordinaryDeposit").text("0元");
						} else {
							alert("退还失败");
						}

					}
				})
			}else {
				alert("您的押金为0元")
			}
		}



	</script>
</head>
<body scroll="no">
<div id="father">
		<input type="hidden" id="uid"/>
	<div id="topBox">
		<div class="colorBox"></div>
		<div class="textBox">&nbsp;用户信息</div>
	</div>

	<div id="information">
		<div id="informationLeft">
			<div id="userImg">
				<img src="img" id="img1"/>
			</div>
			<div id="textBox2">
				<button type="button" id="updateImg" data-toggle="modal" data-target="#myModal">
					修改头像
				</button>

			</div>
		</div>
		<div id="informationRight">
			<div class="textBoxes">
				<div class="colorBox2">昵称：</div>
				<div class="bottomLine" id="userName">NaN</div>
			</div>
			<div class="textBoxes">
				<div class="colorBox2">性别：</div>
				<div class="bottomLine" id="userSex">NaN</div>
			</div>
			<div class="textBoxes">
				<div class="colorBox2">邮箱：</div>
				<div class="bottomLine" id="userEmail">NaN</div>
			</div>
			<div class="textBoxes">
				<div class="colorBox3">手机号：</div>
				<div class="bottomLine" id="userPhone">NaN</div>
			</div>
			<div class="textBoxes">
				<div class="moneyBox">钱包金额：</div>
				<div class="moneyLine" id="ordinaryMoney">NaN元</div>
			</div>
			<div class="textBoxes">
				<div class="moneyBox">押金金额：</div>
				<div class="moneyLine" id="ordinaryDeposit">NaN元</div>
			</div>
			<div class="textBoxes">
				<div class="colorBox4">订单次数：</div>
				<div class="bottomLine" id="orderNumbers">NaN</div>
			</div>
			<div class="textBoxes">
				<div class="colorBox4">注册时间：</div>
				<div class="bottomLine" style="font-size: 90%" id="userregistrationTime">NaN</div>
			</div>

			<div id="buttonGroup">
				<input type="button" class="button10" value="完善信息" data-toggle="modal" data-target="#myModal10"/>
				<input type="button" class="button1" value="钱包充值" data-toggle="modal" data-target="#myModal2"/>
				<input type="button" class="button1" value="押金充值" data-toggle="modal" data-target="#myModal3"/>
				<input type="button" class="button1" value="退还押金" data-toggle="modal" data-target="#myModal4"/>
			</div>

		</div>
	</div>

	<div id="minBox">
		<div class="colorBox"></div>
		<div class="textBox">&nbsp;订单列表</div>
	</div>

	<div id="tableBox">
		<div id="findBox">
			<div id="find1">
				<div class="textBox2">订单编号：</div>
				<input type="text" placeholder="请输入编号" class="textInput" id="userordernum"/>
			</div>

			<div id="find2">
				<div class="textBox2">金额区间：</div>
				<input type="text" placeholder="请输入起始金额" class="moneyInput" id="startMoney"/>
				<div style="float: left ;margin-left: 1%;margin-right: 1%"><b>~</b></div>
				<input type="text" placeholder="请输入结束金额" class="moneyInput" id="endMoney"/>
			</div>

			<div id="find3">
				<div class="textBox2">订单状态：</div>
				<select id="userorderstatus">
					<option value="0">-请选择-</option>
					<option value="1">当前订单</option>
					<option value="2">历史订单</option>
				</select>
			</div>

			<div id="find4">
				<div class="textBox2">结算状态：</div>
				<select id="userordersettlementstatus">
					<option value="0">-请选择-</option>
					<option value="1">正常结算</option>
					<option value="2">异常结算</option>
				</select>
			</div>
			<input type="button"id="button2" value="查询" onclick="find()"/>
			<input type="button"id="button3" value="清空" onclick="clean()"/>
			<input type="button" id="button4" value="故障上报" data-toggle="modal" data-target="#myModal5"/>
		</div>
	<table class="table table-bordered table-hover" style="background-color: white ;text-align: center">
		<thead>
			<tr>
				<th>订单编号</th>
				<th>下单时间</th>
				<th>归还时间</th>
				<th>租借时长(天)</th>
				<th>支付状态</th>
				<th>订单状态</th>
				<th>结算状态</th>
				<th>总计金额</th>
				<th>异常</th>
				<th>操作</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>John</td>
			</tr>
		</tbody>
		<tfoot>

		</tfoot>
	</table>
		<div>
			<div  style="margin: auto ;float: left;margin-right: 1%;font-size: 140%;line-height: 200%" >
				选择显示的条数:
				<select id="pageSize">
					<option value="3">3</option>
					<option value="5">5</option>
					<option value="8">8</option>
					<option value="10">10</option>
					<option value="12">12</option>
				</select>
			</div>
			<div style="margin: auto ;float: left" id="fenye">
			</div>
		</div>
</div>
</div>
<div class="modal fade" id="myModal10">
	<div class="modal-dialog">
		<div class="modal-content">

			<!-- 模态框头部 -->
			<div class="modal-header" style="background-color: lightseagreen; color: white;">
				<h4 class="modal-title">信息完善/信息修改</h4>
				<button type="button" class="close" data-dismiss="modal" style="color: white;">&times;</button>
			</div>

			<!-- 模态框主体 -->
			<div class="modal-body" style="padding-right: 58px;">
				<div>
					<div>银行卡号</div>
					<div><input type="text"  id="mcard" onkeyup="this.value=this.value.replace(/^([1-9]{1})(\d{14}|\d{18})$/)"/></div>
					<br/>
				</div>
				<div>
					<div>真实姓名</div>
					<div><input type="text" id="mname"/></div>
				</div>
			</div>

			<!-- 模态框底部 -->
			<div class="modal-footer">
				<button type="button" class="btn btn-primary" onclick="wanshan()"  data-dismiss="modal">提交</button>
				<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
			</div>

		</div>
	</div>
</div>
<div class="modal fade" id="myModal">
	<div class="modal-dialog">
		<div class="modal-content">
			<form  id="form-upload" class="form-horizontal" role="form" method="post" enctype="multipart/form-data" action="/login/doUpload">
			<!-- 模态框头部 -->
			<div class="modal-header" style="background-color: black; color: white;">
				<h4 class="modal-title">上传头像</h4>
				<button type="button" class="close" data-dismiss="modal" style="color: white;">&times;</button>
			</div>
			<!-- 模态框主体 -->
			<div class="modal-body" style="padding-right: 58px;">

				<div class="form-group has-success show">
					<label style="padding-left: 10%">新增图片</label>
					<img src="" class="img-circle img-thumbnail img-responsive" id="avarimgs2" alt="" />

					<div class="form-group" style="padding-left: 10%">
						<label class="sr-only" for="xdaTanFileImg2">图片输入</label>
						<input type="file" name="pclogo" id="xdaTanFileImg2" onchange="xmTanUploadImg2(this)">

					</div>
				</div>

			</div>

			<!-- 模态框底部 -->
			<div class="modal-footer">
				<button type="submit" class="btn btn-primary" >提交</button>
				<button type="button" class="btn btn-secondary"  data-dismiss="modal">关闭</button>
			</div>
			</form>
		</div>
	</div>
</div>

<div class="modal fade" id="myModal2">
	<div class="modal-dialog">
		<div class="modal-content">

			<!-- 模态框头部 -->
			<div class="modal-header" style="background-color: mediumvioletred; color: white;">
				<h4 class="modal-title">钱包充值</h4>
				<button type="button" class="close" data-dismiss="modal" style="color: white;">&times;</button>
			</div>

			<!-- 模态框主体 -->
			<div class="modal-body" style="padding-right: 58px;">

				充值金额:
				<input type="text" placeholder="输入充值金额"  oninput = "value=value.replace(/[^\d]/g,'')" id="money1"/>

			</div>

			<!-- 模态框底部 -->
			<div class="modal-footer">
				<button type="button" class="btn btn-primary" onclick="MoneyRecharge()"  data-dismiss="modal">提交</button>
				<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
			</div>

		</div>
	</div>
</div>

<div class="modal fade" id="myModal3">
	<div class="modal-dialog">
		<div class="modal-content">

			<!-- 模态框头部 -->
			<div class="modal-header" style="background-color: mediumvioletred; color: white;">
				<h4 class="modal-title">押金充值</h4>
				<button type="button" class="close" data-dismiss="modal" style="color: white;">&times;</button>
			</div>

			<!-- 模态框主体 -->
			<div class="modal-body" style="padding-right: 58px;">

				充值金额:
				<input type="text" placeholder="输入充值金额"  oninput = "value=value.replace(/[^\d]/g,'')" id="money2"/>

			</div>

			<!-- 模态框底部 -->
			<div class="modal-footer">
				<button type="button" class="btn btn-primary" onclick="DepositRecharge()"  data-dismiss="modal">提交</button>
				<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
			</div>

		</div>
	</div>
</div>
<div class="modal fade" id="myModal4">
	<div class="modal-dialog">
		<div class="modal-content">

			<!-- 模态框头部 -->
			<div class="modal-header" style="background-color: mediumvioletred; color: white;">
				<h4 class="modal-title">押金退还</h4>
				<button type="button" class="close" data-dismiss="modal" style="color: white;">&times;</button>
			</div>

			<!-- 模态框主体 -->
			<div class="modal-body" style="padding-right: 58px;">

				<input type="button"  data-dismiss="modal" class="operationButton" value="点此退还押金" onclick="DepositReturn()" style="margin-left: 35%">

			</div>

			<!-- 模态框底部 -->
			<div class="modal-footer">
				<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
			</div>

		</div>
	</div>
</div>

<div class="modal fade" id="myModal5">
	<div class="modal-dialog">
		<div class="modal-content">

			<!-- 模态框头部 -->
			<div class="modal-header" style="background-color: indianred; color: white;">
				<h4 class="modal-title">故障报修</h4>
				<button type="button" class="close" data-dismiss="modal" style="color: white;">&times;</button>
			</div>

			<!-- 模态框主体 -->
			<div class="modal-body" style="padding-right: 58px;">

				<div>
					出现故障的订单(编号):
				 <select id="bedName" class="sel3">
					<option>--</option>
				 </select>
				</div>
				<br/>

				<div>
				故障类型：
				 <select id="type" class="sel3">
					<option value="0">其他损坏</option>
					<option value="1">床位损坏</option>
					<option value="2">柜门损坏</option>
					<option value="3">无法归还</option>
				 </select>
				</div>
				<br/>

				<div>
				 反馈内容:
				 <input  type="text" id="userfeedbackContent"  placeholder="输入内容" class="input3"/>
				</div>
				<br/>

			</div>

			<!-- 模态框底部 -->
			<div class="modal-footer">
				<button type="button" class="btn btn-primary" onclick="baoxiu()"  data-dismiss="modal">提交</button>
				<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
			</div>

		</div>
	</div>
</div>

</body>

<script>
function wanshan(){
	var useridentityid =$("#uid").val();
	var car= $("#mcard").val();
	var name=$("#mname").val();

	$.ajax({
		url:"/user/updateidentity",
		type:"post",
		data:{'useridentitybankcard':car,"useridentityrealname":name,"useridentityid":useridentityid},
		datatype:"json",
		success:function(data){
			if(data){
				firstGet();
				alert("认证成功!");
			}else{
				alert("操作失败!");
			}
		}
	})


}



</script>
<script type="text/javascript">

	function mai(id){
		var tian =$("#t"+id).val();
		var bedmessageId =$("#g"+id).val();
		var userorderid =id;
		var money=$("#z"+id).val();
		alert("userorderid"+userorderid+"||bedmessageId"+bedmessageId+"||money:"+money+"||tian:"+tian)
		$.ajax({
			url: "/userorder/updateYuE",
			type: "post",
			datatype: "json",
			data: {"tian": tian, "bedmessageId": bedmessageId, "money": money,"userorderId":userorderid},
			success: function (data) {
				if(data){
					firstGet();
					alert("操作成功！")
				}
			}
		})
	}





	//实现图片的实时更新
	if (typeof FileReader == 'undefined') {
		document.getElementById("xmTanDiv").InnerHTML = "<h1>当前浏览器不支持FileReader接口</h1>";
		document.getElementById("xdaTanFileImg2").setAttribute("disabled", "disabled");
	}
	//选择图片，马上预览
	function xmTanUploadImg2(obj) {
		let file = obj.files[0];
		console.log(obj);console.log(file);
		console.log("file.size = " + file.size);
		let reader = new FileReader();
		reader.onloadstart = function (e) {
			console.log("开始读取....");
		}
		reader.onprogress = function (e) {
			console.log("正在读取中....");
		}
		reader.onabort = function (e) {
			console.log("中断读取....");
		}
		reader.onerror = function (e) {
			console.log("读取异常....");
		}
		reader.onload = function (e) {
			console.log("成功读取....");
			let img = document.getElementById("avarimgs2");
			img.src = e.target.result;
			//或者 img.src = this.result;  //e.target == this
		}
		reader.readAsDataURL(file);
	}

	function tu(){
		var form = new FormData();
		form.append("file", $("#form-upload")[0]);//
		$.ajax({
			url:"/login/doUpload",
			data: form,
			processData:false,
			contentType:false,
			type:"POST",
			dataType:"json",

			success:function (b) {
			alert(b);
		}
	})
	}
	$(document.body).css({
		"overflow-x":"hidden",
		"overflow-y":"hidden"
	});
</script>
</html>
